const express = require('express');
const app = express();
//引入路由器
const userRouter = require('./routes/user');
const proRouter=require('./routes/pro.js');
app.listen(8080, () => {

  console.log('服务器启动成功');
});
app.use(express.static('./public'));
app.use(express.urlencoded({
  extended: false
}));
app.use('/user', userRouter);
app.use('/pro',proRouter);
app.use((err, req, res, next) => {
  console.log(err);
  res.send({
    "code": 500,
    "msg": "服务器错误"

  });
});
